<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
    
</body>
<script>
    // slice方法 为浅拷贝所以对原数组不改变

    var arr = [1,2,3,4,5,6,7]

    let newarr = arr.slice(3)
    console.log(arr)
    console.log(newarr)
    var arra = [1,2,3,4,5,6,7]
    let newarra = arr.slice(3,6)
    console.log("这是两个参数的："+newarra)

    // concat 可以深拷贝但是遇到array object时不可以 此时为浅拷贝
    var arrall = []
    var arr1 = [1,2,3]
    var string1 = "sss"
    var arr2 = [4,5,6]
    
    var alll = arrall.concat(arr1,arr2,string1)
    console.log(alll)

</script>
</html>